package cc.vv.btpartyjob.partymanager.adapter

import android.widget.TextView
import cc.vv.baselibrary.adapter.SimpleCommonAdapter
import cc.vv.baselibrary.adapter.holder.ExtendViewHolder
import cc.vv.baselibrary.view.LKCircleImageView
import cc.vv.btpartyjob.partymanager.R
import cc.vv.btpartyjob.partymanager.moudel.bean.TeamWorkObj
import cc.vv.lkimagecomponent2.LKImage
import cc.vv.lkimagecomponent2.lib.mode.ScaleMode

/**
 * 工作队adapter
 * Created by Chen.qi on 2018/10/24.
 */
class WorkTeamListAdapter(layoutResId: Int) : SimpleCommonAdapter<TeamWorkObj>(layoutResId) {
    override fun convert(helper: ExtendViewHolder, item: TeamWorkObj, position: Int) {
        //头像
        val viewHead = helper.getView<LKCircleImageView>(R.id.lkv_itwW_managerHeadPic)
        LKImage.load().load(item.faceUrl).placeHolder(R.mipmap.icon_party_head_def).error(R.mipmap.icon_party_head_def)
                .scale(ScaleMode.CENTER_CROP).into(viewHead)
        //姓名
        helper.getView<TextView>(R.id.tv_itwW_name)?.text = item.pname

        //职务
        helper.getView<TextView>(R.id.tv_itwW_zhiwu)?.text = item.plant

    }
}